package console;

import java.util.Vector;

public class ActionSet {
	final static Vector<ConsoleAction> actionList = new Vector<ConsoleAction>();
	public final static ActionProperties properties = new ActionProperties();
	public static void init() {
		properties.put("TASK_MANAGER_OPEN",false);
		actionList.clear();
	}
	public static boolean update(String key,boolean value) {
    if(properties.containsKey(key)) {
		  properties.put(key,value);
  		refresh();
      return(true);
    } else {
      System.err.println("updating a flag that does not exists:"+key);
      return(false);
    }
	}
	public static void add(ConsoleAction a) {
		actionList.add(a);
	}
  public static void addProperty(String key,boolean state) {
    properties.put(key,state);
    System.out.println("key:"+key);
  }
	public static void refresh() {
		for(ConsoleAction a :actionList) {
			a.checkProperties(properties);
		}
	}
}
